package com.qdjwz.iceblue;

import android.os.Bundle;
import android.app.Activity;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.Menu;
import android.view.View;
import android.widget.Toast;

import com.qdjwz.iceblue.common.CheckVerison;
import com.qdjwz.iceblue.common.ConnectWifi;

import java.util.ArrayList;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //判断是否开启Wifi网络
        ConnectWifi conn = new ConnectWifi(this);
        if(conn.checkConnection()){

            ViewPager myViewPager = (ViewPager)findViewById(R.id.myViewPage);
            ArrayList<View> viewList = new ArrayList<View>();

            MyPageAdapter pageAdapter = new MyPageAdapter(this,viewList);


            //弹出升级对话框
            new CheckVerison(this);
        }else{
            Toast.makeText(this,"未连接WIFI网络",Toast.LENGTH_LONG);
            return;
        }
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
}
